package ch8;
import java.util.Iterator;
import java.util.Scanner;
import java.util.SortedSet;
import java.util.*;
import abc.Test;

import ch8.AutoStudent;
public class TreeTest {
public static void main(String[] args) {
	SortedSet<AutoStudent> set = new TreeSet<AutoStudent>();
	AutoStudent s1 = new AutoStudent(1.78,"sjx");
	AutoStudent s2 = new AutoStudent(1.65,"yx");
	AutoStudent s3 = new AutoStudent(1.656,"yx1");
	set.add(s2);
	set.add(s1);
	set.add(s3);
	Iterator<AutoStudent> it = set.iterator();
	while(it.hasNext())
	{
		System.out.println(it.next());
		
	}
	/*for(Object a :set)
	{
		AutoStudent b = (AutoStudent)a;
		System.out.println(b);
	}*/
	
}
}
